# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=libcoverart
pkgver=1.0.0
pkgrel=5
pkgdesc="C/C++ library for accessing the MusicBrainz Cover Art Archive"
arch=('loong64' 'x86_64')
url="https://musicbrainz.org/doc/libcoverart"
license=('LGPL')
depends=('neon' 'jansson')
makedepends=('cmake')
source=(https://github.com/metabrainz/$pkgname/releases/download/release-$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('5d9d4a4c46f35754e016affab83957961a364d7a4c7d64447f73bff22a300f44')

prepare() {
  cd $pkgname-$pkgver
  sed -i 's/ -Werror//' */CMakeLists.txt
}

build() {
  cd $pkgname-$pkgver
  cmake . \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release
  CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -Wno-error" make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
